import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)


const routes = [{
        path: '/',
        name: 'Home',
        redirect: '/find', //重定向,默认显示的是find
        component: Home
    },
    {
        path: '/about',
        name: 'About',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/About.vue')
    },
    {
        path: '/index',
        name: 'Index',

        component: () =>
            import ('../views/index.vue'),
        children: [{
            path: '/my',
            name: 'My',
            component: () =>
                import ('../views/my.vue'),
        }, {
            path: '/find',
            name: 'Find',
            component: () =>
                import ('../views/find.vue')
        }]
    },
    {
        path: '/loginPhone',
        name: 'LoginPhone',
        component: () =>
            import ('../views/loginPhone.vue'),
        // children: [{
        //     path: 'loginPassword',
        //     name: 'LoginPassword',
        //     component: () =>
        //         import ('../views/loginPassword.vue'),
        // }]
    },
    {
        path: '/loginPhone/loginPassword',
        name: 'LoginPassword',
        component: () =>
            import ('../views/loginPassword.vue')
    },
]

const router = new VueRouter({
    linkExactActiveClass: 'active',
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router